{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Microsoft Sans Serif;}{\f4\fmodern\fprq1\fcharset0 Courier New;}{\f5\fnil\fprq0\fcharset0 consolas;}{\f6\fnil\fprq2\fcharset0 Arial Unicode MS;}{\f7\fnil\fprq2\fcharset0 MS Mincho;}{\f8\fnil\fprq2\fcharset0 Tahoma;}{\f9\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red0\green128\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\afs28\lang255\ltrch\dbch\af7\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af9\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af9\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\i\loch\f0\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af9\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033\sbasedon1\snext7 Preformatted Text;}
}
{\info{\creatim\yr2011\mo7\dy19\hr5\min40}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af3\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\f3\fs24\lang1033\b\loch\f3\fs24\lang1033\b {\rtlch \ltrch\loch\f3\fs24\lang1033\i0\b Scene Graph}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af3\afs18\lang255\ltrch\dbch\af3\langfe255\hich\f3\fs18\lang1033\loch\f3\fs18\lang1033
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af3\afs20\lang255\ltrch\dbch\af3\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 This sample shows how to construct a simple scene graph and illustrates how parent nodes can affect their children. }
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 The teapot is attached to a node that is centered at the origin (0, 0, 0), but the teapot itself is translated by (-50, 0, 0). Rotating the node rotates the teapot about the origin, rather than rotating the teapot in place. Also, the scene graph's root nod
e has a white point light attached, which the teapot inherits.}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af3\afs20\lang255\ltrch\dbch\af3\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Another shape, a box, is attached to the scene root. It has light inheritance turned off (it only uses local lights), instead a green point light is attached directly to the box. Therefore the white light does not affect the box and the green light does no
t affect the teapot.}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af3\afs24\lang255\ab\ltrch\dbch\af3\langfe255\hich\f3\fs24\lang1033\b\loch\f3\fs24\lang1033\b {\rtlch \ltrch\loch\f3\fs24\lang1033\i0\b Scene Graph Organization}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af3\afs20\lang255\ltrch\dbch\af3\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 The sample's scene organization looks something like this:}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 RootNode}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 /                \\}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch  }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TeapotNode    BoxMesh}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch            }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 |}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch        }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TeapotMesh}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 The scene graph has a set hierarchy, all scene elements derive from type {\rtlch\ltrch\dbch\hich\b\loch\b Spatial. }By default there are two very important subclasses:}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 1. Internal elements (e.g. {\rtlch\ltrch\dbch\hich\i\loch\i RootNode} and {\rtlch\ltrch\dbch\hich\i\loch\i TeapotNode}), are scene objects that can have any number of children are of type {\rtlch\ltrch\dbch\hich\b\loch\b Node}. Nodes can be thought of as logical elements that exist in space, as they provide a means of grouping meshes or providing a hi
erarchy (as described below). }
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 2. Leaf elements (e.g. {\rtlch\ltrch\dbch\hich\i\loch\i BoxMesh} and {\rtlch\ltrch\dbch\hich\i\loch\i TeapotMesh}), are visible geometry and are of type {\rtlch\ltrch\dbch\hich\b\loch\b Mesh. }Meshes do not own children, but they contain the geometric and material data for rendering, as well as the means to render themselves.}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch          }
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 In the scene graph, child elements inherit the following from their parents:}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch  }
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}{\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 1. Transforms (parent moves, child moves with it)}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 2. Bounding Volumes (the tree doubles as a Bounding Volume Hierarchy)}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 3. Lights }
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch  }
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 This allows you to develop a complex, but easy to manage/setup relationship between objects with minimal effort. Having the tree as a BVH allows for performance optimizations, e.g. the ability cull large sections of the scene graph for processing (renderin
g, ray picking, etc), if the scene objects are spatially coherent (e.g. close together).}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Leaf objects in the scene graph are geometries (of type Mesh) that also implement IRenderable. The rendering system has no notion of the built-in scenegraph, which allow for other scene management implementations.}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 The scene graph is not directly managed, such as an \'93Oct-Tree\'94, it will exist in the order that you attach objects. However, the user has the ability to control the order of how meshes are drawn using the engine's render queue functionality. When the scene
 graph is drawn, it first does a frustum cull check. If the object is a node, its children are traversed. If it's a mesh, it's added to the render queue (or drawn immediately if set to skip). The render queue sorts IRenderables based on their material to a
chieve two goals:}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 1. Batching. Materials with similar shaders, textures, and render states will be ordered close together to try and minimize state switching (e.g. redundant state calls are not pushed through to the device if nothing has been changed). Opaque objects a
re also rendered front-to-back to try and reduce overdraw (draw closest pixels first, so occluded pixels get rejected by the depth buffer to reduce work).}
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 
\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af8\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 {\rtlch \ltrch\loch      }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 2. Correct rendering. The queue allows you to specify the draw order of geometry, which is helpful for transparent geometry. Transparent geometry is ordered back-to-front to achieve proper rendering, and has the option for two-sided rendering. Other o
ptions allow geometry to always be drawn first or last, regardless of its position in the scene graph.}
\par }